chore: include the build-duration-milliseconds github runner monitoring in the reusable workflow#751
Open
Kerruba wants to merge 1 commit into
Open
chore: include the build-duration-milliseconds github runner monitoring in the reusable workflow#751Kerruba wants to merge 1 commit into
Kerruba wants to merge 1 commit into
Conversation
…ng in the reusable workflow
|
|
Contributor
There was a problem hiding this comment.
Pull request overview
This PR centralizes build-duration collection in the shared start-build-monitor + submit-build-status actions, removing the need for per-repo duration calculation and ensuring duration/resource metrics are captured before auth/BigQuery submission.
Changes:
- Record job start time (epoch millis) in
start-build-monitorand compute/validate elapsed duration insubmit-build-status. - Add explicit-duration validation and precedence resolution (explicit input overrides monitor-derived duration).
- Update
submit-build-statusworkflow step ordering and documentation; add a shell test script for duration behavior.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| submit-build-status/validate-build-duration.sh | Adds validation/normalization for explicit build_duration_millis input with max 72h cap. |
| submit-build-status/test_build_duration.sh | Adds a shell-based test harness covering duration validation and monitor-derived duration behavior. |
| submit-build-status/stop-and-collect-build-monitor.sh | Computes duration from start timestamp, makes monitor paths overridable, and emits build_duration_millis as a step output. |
| submit-build-status/resolve-build-duration.sh | Implements precedence selection between explicit and monitor-derived duration. |
| submit-build-status/README.md | Documents automatic duration behavior, precedence, and updated integration example. |
| submit-build-status/action.yml | Validates duration input, collects metrics earlier, resolves duration, and submits the resolved duration field. |
| start-build-monitor/start-build-monitor.sh | Writes start timestamp (epoch millis) and clears stale monitor state at startup; improves quoting. |
| start-build-monitor/README.md | Updates docs to include duration collection and guidance to keep the step first in the job. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
10
to
+14
| # NOTE: these paths are shared with start-build-monitor.sh -- if changed, update both | ||
| PID_FILE=/tmp/_monitor-start.pid | ||
| LOG_FILE=/tmp/_monitor-start.log | ||
| PID_FILE="${BUILD_MONITOR_PID_FILE:-/tmp/_monitor-start.pid}" | ||
| LOG_FILE="${BUILD_MONITOR_LOG_FILE:-/tmp/_monitor-start.log}" | ||
| START_TIME_FILE="${BUILD_MONITOR_START_TIME_FILE:-/tmp/_monitor-start.epoch-millis}" | ||
| NET_DEV_FILE="${BUILD_MONITOR_NET_DEV_FILE:-/proc/net/dev}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Centralize build-duration collection in the shared submit-build-status action
Previously repositories were calculating build_duration_millis in its own observe-build-status wrapper (duplicated logic, relying on an unreliable GITHUB_ACTION_PATH directory mtime). This moves the calculation into the shared start-build-monitor / submit-build-status actions.
What changed:
whole job.
field with a warning instead of failing submission.
Backward compatibility: Fully backward compatible.